Skip to content

John6797/sc 7776/add more coverage to integration unit tests#283

Merged
johnwalz97 merged 7 commits intomainfrom
john6797/sc-7776/add-more-coverage-to-integration-unit-tests
Jan 3, 2025
Merged

John6797/sc 7776/add more coverage to integration unit tests#283
johnwalz97 merged 7 commits intomainfrom
john6797/sc-7776/add-more-coverage-to-integration-unit-tests

Conversation

@johnwalz97
Copy link
Contributor

Internal Notes for Reviewers

Adding more test coverage and fixing an issue with the run_test function from my last PR.

External Release Notes

@johnwalz97 johnwalz97 added bug Something isn't working internal Not to be externalized in the release notes chore Chore tasks that aren't bugs or new features labels Jan 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2025

PR Summary

This pull request introduces several enhancements and refactorings to the test suite and test decorator logic within the project. Key changes include:

  1. Addition of New Tests:

    • New test cases have been added to tests/test_validmind_tests_module.py to cover functionalities such as list_tags, list_tasks, list_tasks_and_tags, and test_decorators. These tests ensure that the functions return expected data types and contain valid data.
    • Enhanced test coverage for the test_test_provider_registration to verify the registration and functionality of a fake test provider.
  2. Refactoring of Test Decorator Logic:

    • The validmind/tests/decorator.py file has been refactored to improve the logic for saving test functions. The source code of the function is now captured before it is wrapped by the test decorator, ensuring the original function's source is preserved.
    • The save function within the decorator now uses a pre-captured source and formats it using black if available.
  3. Removal of Redundant Code:

    • Unnecessary parameters such as generate_description have been removed from the run_test function in validmind/tests/run.py, simplifying the function's logic.
  4. Minor Enhancements:

    • A new notebook path notebooks/how_to/explore_tests.ipynb has been added to the list of notebooks in scripts/run_e2e_notebooks.py.

These changes aim to improve the robustness of the test suite and streamline the test function handling process.

Test Suggestions

  • Run the entire test suite to ensure all new and existing tests pass.
  • Test the list_tags, list_tasks, and list_tasks_and_tags functions with various data to ensure they handle edge cases.
  • Verify the test_decorators functionality by creating additional test cases with different tags and tasks.
  • Check the save function in the decorator to ensure it correctly saves functions with and without additional imports.
  • Perform integration testing to ensure the refactored run_test function behaves as expected in different scenarios.

Copy link
Contributor

@juanmleng juanmleng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks John!

@johnwalz97 johnwalz97 merged commit cd48956 into main Jan 3, 2025
6 checks passed
@johnwalz97 johnwalz97 deleted the john6797/sc-7776/add-more-coverage-to-integration-unit-tests branch January 3, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working chore Chore tasks that aren't bugs or new features internal Not to be externalized in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants